package cn.yusei.teamTribe.entity;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class ValidateCode {

	private String sessionId;
	private byte[]data;
	
	public ValidateCode(String sessionId, InputStream in)
	{
		this.sessionId = sessionId;
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		try
		{
			int len = -1;
			byte[] temp = new byte[1024];
			while((len = in.read(temp)) != -1)
			{
				out.write(temp, 0, len);
			}
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		this.data = out.toByteArray();
	}
	
	public String getSessionId()
	{
		return sessionId;
	}
	
	public byte[] getData()
	{
		return data;
	}
	
}
